package com.binyouwei.designpatterns.structural_type.proxy.static_state;

import com.binyouwei.designpatterns.structural_type.proxy.ProxyRenter;

/**
 * @author 宾有为
 * Created on 2024/7/15 16:00
 * Social homepage: https://blog.csdn.net/baidu_41616022
 * @desc 静态代理 - 代理类，表示中介
 **/
public class ProxyAgent implements ProxyRenter {
    private ProxyRenter renter;

    public ProxyAgent(ProxyRenter renter) {
        this.renter = renter;
    }

    @Override
    public void showHouse() {
        System.out.println("Agent is preparing to show the house...");
        renter.showHouse();
        System.out.println("Agent is collecting fees for showing the house.");
    }

    @Override
    public void signContract() {
        System.out.println("Agent is preparing the contract...");
        renter.signContract();
        System.out.println("Agent is collecting fees for signing the contract.");
    }
}

